﻿@using Projectmanagement.Models
@{
    ViewBag.Title = "Edm";
}
@(Html.Telerik().Grid<_Edm>()
                        .Name("Edm")
    .DataKeys(keys => { keys.Add(item => item.ID); })
    .ToolBar(toolBar => toolBar.Template(
                @<text> EDM表： <a class="t-button t-grid-add" href="/Edm?Edm-mode=insert">新增记录</a>
</text>
                ))
        .DataBinding(dataBinding =>
        {
            dataBinding.Ajax()
            .Select("_SelectIndex", "Edm")
            .Insert("_InsertAjaxEditing", "Edm")
            .Update("_SaveAjaxEditing", "Edm")
            .Delete("_DeleteAjaxEditing", "Edm");
        })
            .Columns(columns =>
            {
                columns.Bound(item => item.CompanyName).Width(100);
                columns.Bound(item => item.ContactName).Width(100);
                columns.Bound(item => item.ContaceMobile).Width(100);
                columns.Bound(item => item.Superior).Width(100);
                columns.Bound(item => item.ContactTitle).Width(100);


                columns.Command(commands =>
                {
                    commands.Edit();
                    commands.Delete();
                }).Title("操作").Width(200);
            }).Resizable(r => r.Columns(true))
            .Editable(editing => editing.Mode(GridEditMode.PopUp))
               .Pageable(item => item.Style(GridPagerStyles.Status).PageSize(50).PageOnScroll(true)).Scrollable(s => s.Height(600)).Scrollable(c => c.Height(600))
    .Resizable(resizing => resizing.Columns(true))
            .Sortable()
        )
<script type="text/javascript">

    function onEdit(e) {

    }


</script>
